let app = getApp()
Page({

  /**
   * 页面的初始数据
   */
  data: {

  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var that = this
    var k = wx.getStorageSync('key');
    var u = wx.getStorageSync('u');
    wx.request({
      url: app.configData.shop.api_url + '/index.php?ctl=Buyer_Order&met=getEvaluationByOrderId&typ=json',
      method: 'GET',
      data: {
        k: k,
        u: u,
        order_id: options.order_id
      },
      header: {
        'content-type': 'application/json'
      },
      success: function (res) {
        var add = []
        for (var i in res.data.data) {
          var arr = res.data.data[i]
          for (var s in arr) {
            add.push(arr[s])
            that.setData({
              evaluation: add,
            })

          }
        }

      }
    })
  },
  //图片点击事件
  imgYu: function (event) {
    var src = event.currentTarget.dataset.src;//获取data-src
    var imgList = event.currentTarget.dataset.list;//获取data-list
    //图片预览
    wx.previewImage({
      current: src, // 当前显示图片的http链接
      urls: imgList // 需要预览的图片http链接列表
    })
  }

})